package com.qf.service.serviceimpl;

import com.qf.dao.AdminDao;
import com.qf.dao.daoimpl.AdminDaoImpl;
import com.qf.pojo.Admin;
import com.qf.service.AdminService;

import java.sql.SQLException;

/**
 * @author Mr.Liu
 * @date 2021/11/17 19:56
 */

public class AdminServiceImpl implements AdminService {
    @Override
    public Admin find(String adminname, String adminpassword) {
        try {
            AdminDao ad = new AdminDaoImpl();
            Admin admin = ad.findAdmin(adminname);
            if(admin != null){
                if(adminpassword.equals(admin.getAdminpassword())){
                    return admin;
                }
            }
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return null;
    }
}
